package com.lin.java.tool.send.enums;

import com.lin.java.tool.send.model.Sms;
import com.lin.java.tool.send.sms.SmsStrategy;
import com.lin.java.tool.send.sms.strategy.aliyun.AlibabaSmsStrategy;
import com.lin.java.tool.send.sms.strategy.local.ControlSmsStrategy;
import lombok.Getter;

import java.util.function.Function;

/**
 * @author linjiang
 * @date 2024/8/19
 * @fn
 */
@Getter
public enum PlatformEnum {
    LOCAL("local", sms -> new ControlSmsStrategy(sms)),
    ALIYUN("aliyun", sms -> new AlibabaSmsStrategy(sms)),
    TENCENT("tencent", sms -> new ControlSmsStrategy(sms));


    private String platform;
    private Function<Sms, SmsStrategy> function;

    PlatformEnum(String platform, Function<Sms, SmsStrategy> function) {
        this.platform = platform;
        this.function = function;
    }
}
